package dao.impl;

import dao.WorkOrderDao;
import entry.WorkOrder;
import pojo.WorkMess;
import util.DBHelper;

import java.util.ArrayList;

public class WorkOrderDaoImpl implements WorkOrderDao {
    DBHelper db=new DBHelper();
    @Override
    public int insertWork(WorkOrder wk) {
        String sql="insert into workorder values(null,?,?,?,?,current_date)";
       return db.updateinfo(sql,wk.getpId(),wk.getExecutor(),wk.getDescription(),wk.getOrderLevel());
    }

    @Override
    public ArrayList selectAll() {

        String sql="select w.*,p.* from workorder as w  inner join project as p on w.pId=p.pId  ";
        return db.selectinfo(sql,WorkMess.class);
    }




}
